
import { form } from './data'

function onQuantityInput(input) {
    // USD
    // if (autoCalcAmount.value == false) return
    console.log(input)
    if (input === '') return
    form.value.price = parseFloat((form.value.amount / input).toFixed(4))

}
function onAmountInput(input) {
    // RMB
    // if (autoCalcAmount.value == false) return
    if (input === '') return
    form.value.price = parseFloat((input / form.value.quantity).toFixed(4))
    // if (input === '') return

    // form.value.quantity = isCash ? 0 : parseFloat(((form.value.amount - form.value.fee) / form.value.price).toFixed(2))
}

export {
    onQuantityInput,
    onAmountInput
}